////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _CFACECONTROL_H_
#define _CFACECONTROL_H_

////////////////////////////////////////////////////////////////////////////////////////////////////

#include "CGlobals.h"
#include "IControl.h"
#include "IrrArray.h"
#include "Vector3d.h"
#include "Vector2d.h"
#include "position2d.h"
#include "SColor.h"

////////////////////////////////////////////////////////////////////////////////////////////////////

class CFaceControl : public IControl
{
	CFaceControl (); // no default constructor
	CFaceControl (const CFaceControl&); // no copy constructor
	CFaceControl& operator= (const CFaceControl&); // no assignment

public:
	CFaceControl (ISceneNode* node, vector3df axis , vector3df sizes , SColor normalColor, SColor highlightColor);
	virtual ~CFaceControl ();

	virtual bool OnEvent (const SEvent& event);
	virtual void draw ();
	void updateControl(vector3df size );

private:
	
	ICameraSceneNode* m_camera;
	ISceneNode* m_node;
	
	vector3df m_axis;	

	SColor m_normalColor;
	SColor m_highlightColor;

	bool m_activated;
	bool m_highlighted;
	
	bool onMouseEvent (const SEvent::SMouseInput& event);
	bool isPointOverControl (position2di pt) const;
	f32 getScreenCoordinates (array<vector2df>* coordinates) const;

	position2di m_mouseStart;		
	vector3df m_centroid;	
	vector3df m_size;
	vector3df m_nodeStart;	
	vector3df m_nodeCurent;
	//usd only for drawing 
	vector3df m_nodeStartPos;	
	vector3df m_nodeCurentPos;
	/*vector2df getScreenAxis () const;*/
};

#endif //_CFACECONTROL_H_
////////////////////////////////////////////////////////////////////////////////////////////////////
